package main;

import javax.swing.JOptionPane;

import views.Graphics;
import views.OtherWindowGraphics;
import views.WindowGraphics;
import models.Game;
import controllers.Controller;

public class Main
{
    public static void main(String[] args)
    {
        Game       game       = new Game();
        Controller controller = new Controller(game);
        Graphics   view       = null;

    	final String choice1 = "Vista 1";
    	final String choice2 = "Vista 2";

    	String[] choices = {choice1, choice2};

    	String optionview = null ;
  	
    	optionview = (String)JOptionPane.showInputDialog(null, "Seleccione vista:"
	                     , "Vista", JOptionPane.QUESTION_MESSAGE
	                     , null, choices, choices[0]);        
    	try
    	{
	        if (optionview.equals(choice1))
	            view = new OtherWindowGraphics(controller);
	        else
	            view = new WindowGraphics(controller);
	
	        controller.setView(view);
	        view.init();
	        view.draw();
        }
    	catch (Exception e)
    	{
          //if exit without select a choices   	
		}
    }
}
